import request from '@/utils/request'
// =============================================================会员类别相关=========================================================
export const memberClassifyList = () => {
  return request({
    url: '/member/classify/list'
  })
}

export const memberClassifyDetail = (id) => {
  return request({
    url: `/member/classify/detail/${id}`
  })
}

/**
 * 保存会员分类
 */
export const saveMemberClassify = (data) => {
  return request({
    url: '/member/classify/save',
    method: 'POST',
    data
  })
}

/**
 * 删除指定用户
 */
export const deleteMemberClassify = (id) => {
  return request({
    url: `/member/classify/delete/${id}`
  })
}
// =============================================================会员相关=========================================================
/**
 * 获取当前用户序列号
 */
export const generateMemberNumber = () => {
  return request({
    url: '/member/generate-member-number'
  })
}

/**
 * 创建会员
 */
export const createMember = (data) => {
  return request({
    url: '/member/create',
    method: 'POST',
    data
  })
}

/**
 * 会员列表
 */
export const memberList = (data) => {
  return request({
    url: '/member/list',
    params: data
  })
}
/**
 * 会员详情
 */
export const memberDetail = (id) => {
  return request({
    url: `/member/detail/${id}`
  })
}

/**
 * 编辑用户信息
 */
export const editMember = (data) => {
  return request({
    url: '/member/edit',
    method: 'POST',
    data
  })
}

/**
 * 用户充值
 */
export const memberRecharge = (data) => {
  return request({
    url: '/member/recharge',
    method: 'POST',
    data
  })
}

/**
 * 用户充值
/**
 * 会员列表
 */
export const feeRecord = (data) => {
  return request({
    url: '/member/fee-record',
    params: data
  })
}
